home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / gs25dos1.zip / USE.DOC < prev   
Text File  |  1992-08-18  |  17KB  |  460 lines

  1.    Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.
  19.  
  20. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22. This file, use.doc, describes how to use the Ghostscript language
  23. interpreter.
  24.  
  25. For an overview of Ghostscript and a list of the documentation files, see
  26. README.  
  27.  
  28. ********
  29. ******** How to use the Ghostscript interpreter ********
  30. ********
  31.  
  32. The file name of the Ghostscript interpreter is gs.exe (MS-DOS and VMS) or
  33. gs (Unix).  To run it, you also need some external initialization files:
  34.     gs_*.ps (gs_2asc.ps, gs_dps1.ps,
  35.          gs_fonts.ps, gs_init.ps, gs_lev2.ps, gs_statd.ps)
  36.     sym__enc.ps
  37.     uglyr.gsf
  38.     Fontmap
  39. as well as any other fonts from the Ghostscript distribution (.gsf and
  40. .pfa files).
  41.  
  42. To invoke the interpreter, give the command
  43.     gs <filename1> ... <filenameN>
  44. The interpreter will read in the files in sequence and execute them.
  45. After doing this, it reads further input from the primary input stream
  46. (normally the keyboard).  Each line (i.e. characters up to a <return>) is
  47. interpreted separately.  To exit from the interpreter, type quit<return>.
  48. The interpreter also exits gracefully if it encounters end-of-file.
  49. Typing the interrupt character, e.g., control-C, is also safe.
  50.  
  51. The interpreter recognizes several switches described below, which may appear
  52. anywhere in the command line and apply to all files thereafter.
  53.  
  54. You can get a help message by invoking Ghostscript with
  55.     gs -h
  56. or
  57.     gs -?
  58. This message also lists the available devices.  For a little more
  59. information, a one-line description of each device appears near the
  60. beginning of the file devs.mak.
  61.  
  62. Choosing the output device
  63. --------------------------
  64.  
  65. Ghostscript may be built with multiple output devices.  Ghostscript
  66. normally opens the first one and directs output to it.  To use device xyz
  67. as the initial output device, include the switch
  68.     -sDEVICE=xyz
  69. in the command line.  Note that this switch must precede the first .ps
  70. file, and only its first invocation has any effect.  For example, for
  71. printer output in a normal configuration that includes an Epson printer
  72. driver, you might use the shell command
  73.     gs -sDEVICE=epson myfile.ps
  74. instead of just
  75.     gs myfile.ps
  76. Alternatively, you can type
  77.     (epson) selectdevice
  78.     (myfile.ps) run
  79. All output then goes to the printer instead of the display until further
  80. notice.  You can switch devices at any time by using the selectdevice
  81. procedure, e.g.,
  82.     (vga) selectdevice
  83. or
  84.     (epson) selectdevice
  85. As yet a third alternative, you can define an environment variable
  86. GS_DEVICE as the desired default device name.  The order of precedence for
  87. these alternatives, highest to lowest, is:
  88.     selectdevice
  89.     (command line)
  90.     GS_DEVICE
  91.     (first device in build list)
  92.  
  93. To select the density on a printer, use
  94.     gs -sDEVICE=<device> -r<xres>x<yres>
  95. For example, on a 9-pin Epson-compatible printer, you can get the
  96. lowest-density (fastest) mode with
  97.     gs -sDEVICE=epson -r60x72
  98. and the highest-density mode with
  99.     gs -sDEVICE=epson -r240x72.
  100. On a 24-pin printer, the lowest density is
  101.     gs -sDEVICE=epson -r60x60
  102. and the highest-density 24-pin mode is
  103.     gs -sDEVICE=epson -r360x180
  104.  
  105. If you select a printer as the output device, Ghostscript also allows you
  106. to control where the device sends its output.  Normally, output goes
  107. directly to the printer (PRN) on MS-DOS systems, and to a scratch file on
  108. Unix or VMS systems.  To send the output to a series of files foo1.xyz,
  109. foo2.xyz, ..., use the switch
  110.     -sOutputFile=foo%d.xyz
  111. (For compatibility with older versions of Ghostscript, -sOUTPUTFILE=
  112. also works.)  The %d is a printf format specification; you can use
  113. other formats like %02d.  Each file will receive one page of output.
  114. Alternatively, to send the output to a single file foo.xyz, with all
  115. the pages concatenated, use the switch
  116.     -sOutputFile=foo.xyz
  117.  
  118. On Unix systems, you can send the output directly to a pipe.  For
  119. example, to pipe the output to the command `lpr' (which, on many Unix
  120. systems, is the command that spools output for a printer), use the
  121. switch
  122.     -sOutputFile=\|lpr
  123.  
  124. To find out what devices are available, type
  125.     devicenames ==
  126. after starting up Ghostscript.  Alternatively you can use the -h or
  127. -? switch in the command line, as described above.
  128.  
  129. Device configuration
  130. --------------------
  131.  
  132. Ghostscript is normally configured to expect U.S. letter paper,
  133. although there is a way to make A4 paper the default for certain
  134. printers at compilation time (see devs.mak for details).  To select a
  135. different paper size as the default, use the switch
  136.     -sPAPERSIZE=a_known_paper_size
  137. e.g.,
  138.     -sPAPERSIZE=a4
  139. or
  140.     -sPAPERSIZE=legal
  141. You can use any paper size listed in the table at the beginning of
  142. gs_statd.ps.  (Individual documents can also specify a paper size,
  143. which will take precedence over the one specified on the command
  144. line.)
  145.  
  146. Printing on a Hewlett-Packard DeskJet or LaserJet at full resolution
  147. (300 DPI) requires a printer with at least 1.5 Mb of memory.  150 DPI
  148. printing requires only .5 Mb.  You can select 150 DPI printing with
  149. the command line switch
  150.     -r150
  151.  
  152. On MS-DOS systems using the Borland compiler, if Ghostscript gives
  153. you a 'limitcheck in setdevice' error, it may mean Ghostscript's
  154. standard buffer size wasn't large enough.  Likewise, if Ghostscript
  155. gives you a 'VMerror in setdevice' error, it means the buffer size
  156. was too large.  You can use the -dBufferSpace= switch to set the
  157. buffer size to a different value, e.g.,
  158.     -dBufferSpace=50000
  159. The default value is 25000; the smallest value Ghostscript accepts is
  160. 10000; the largest valid value is 65000.
  161.  
  162. File searching
  163. --------------
  164.  
  165. When looking for the initialization files (gs_*.ps), the files related to
  166. fonts, or the file for the 'run' operator, Ghostscript first tries opening
  167. the file with the name as given (i.e., using the current working directory
  168. if none is specified).  If this fails, and the file name doesn't specify
  169. an explicit directory or drive (i.e., doesn't begin with '/' on Unix
  170. systems; doesn't contain a ':' or begin with a '/' or '\' on MS-DOS
  171. systems; doesn't contain a ':' or a square bracket on VMS systems),
  172. Ghostscript will try directories in the following order:
  173.  
  174.     - The directory/ies specified by the -I switch(es) in the command
  175.       line (see below), if any;
  176.  
  177.     - The directory/ies specified by the GS_LIB environment variable,
  178.       if any;
  179.  
  180.     - The directory/ies specified by the GS_LIB_DEFAULT macro in the
  181.       Ghostscript makefile, if any.
  182.  
  183. Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a
  184. single directory, or a list of directories separated by a character
  185. appropriate for the operating system (':' on Unix systems, ';' on VMS
  186. systems, ';' on MS-DOS systems).
  187.  
  188. VMS-specific notes
  189. ------------------
  190.  
  191. On VMS systems, the last character of each "directory" name indicates what
  192. sort of entity the "directory" references.  If the "directory" name ends
  193. with a colon, it is taken as referring to a logical device, e.g.:
  194.         $ DEFINE GHOSTSCRIPT_DEVICE DUA1:[GHOSTSCRIPT_14]
  195.         $ DEFINE GS_LIB GHOSTSCRIPT_DEVICE:
  196. If the "directory" name ends with a closing square bracket, it is taken as
  197. referring to a real directory, e.g.:
  198.         $ DEFINE GS_LIB DUA1:[GHOSTSCRIPT]
  199.  
  200. To run Ghostscript with switches, you must type a command like
  201.  
  202.     $ gs "-dNODISPLAY"
  203.  
  204. because the C run time library will convert the command
  205. parameters/arguments to lowercase unless you enclose them in double quotes
  206. which preserves the case.
  207.  
  208. If you are on an X Windows display (for which gs is built), you can do
  209.  
  210.     $ set display/create/node="domain-name"/transport=tcpip
  211.  
  212. For example,
  213.  
  214.     $ set display/create/node="doof.city.com"/transport=tcpip
  215.  
  216. and then run Ghostscript
  217.  
  218.     $ gs
  219.  
  220. If you write printer output to a file and then want to print the file
  221. later, use the "/PASSALL" qualifier to the PRINT command.
  222.  
  223. MS-DOS notes
  224. ------------
  225.  
  226. If you are running Ghostscript on a MS-DOS machine with a display
  227. that is not EGA/VGA compatible, you must use the Borland compiler.
  228. You must build Ghostscript with the BGI driver as the default, and
  229. you will need the appropriate .BGI file from the Borland Turbo C
  230. library.  (Ghostscript includes the EGA/VGA driver in the
  231. executable.)
  232.  
  233. If you are using the BGI driver, two additional environment variables
  234. become relevant:
  235.  
  236.     BGIPATH - defines the directory where Ghostscript will look for
  237. the appropriate BGI driver.  If BGIPATH is not defined, Ghostscript will
  238. look in the directory defined as BGIDIR in the makefile.  In either case,
  239. if no driver is found in the designated directory, Ghostscript will look
  240. in the current directory.
  241.  
  242.     BGIUSER - a string of the form nn.dname, where nn is a hexadecimal
  243. number giving a display mode and dname is the name of a file containing a
  244. user-supplied BGI driver.  If BGIUSER is defined and the BGI device is
  245. selected, Ghostscript will supply nn as the display mode and will obtain
  246. the driver from the file named dname.
  247.  
  248. Some applications, such as Microsoft Word, require a prologue in front of
  249. the PostScript files they output.  In the case of Word, this is one of the
  250. *.ini files included with the Word distribution.  Other applications may
  251. require other prologues.  These may be specified on the Ghostscript
  252. command line, e.g.,
  253.     gs prologue.ini myfile.ps
  254.  
  255. X Windows resources
  256. -------------------
  257.  
  258. Ghostscript looks for the following resources under the program name
  259. "Ghostscript":
  260.  
  261.     borderWidth - the border width in pixels
  262.         default = 1
  263.     borderColor - the name of the border color
  264.         default = black
  265.     geometry - the window size and placement, WxH+X+Y
  266.         default = ???
  267.     xResolution - the number of x pixels per inch
  268.         default is computed from WidthOfScreen and WidthMMOfScreen
  269.     yResolution - the number of y pixels per inch
  270.         default is computed from HeightOfScreen and HeightMMOfScreen
  271.  
  272. To set these resources, put them in a file (such as ~/.Xdefaults) in the
  273. following form:
  274.  
  275. Ghostscript*geometry:    612x792-0+0
  276. Ghostscript*xResolution: 72
  277. Ghostscript*yResolution: 72
  278.  
  279. Then load the defaults into the X server:
  280.  
  281. % xrdb -merge ~/.Xdefaults
  282.  
  283. Normal switches
  284. ---------------
  285.  
  286.     @filename
  287.         Causes Ghostscript to read filename and treat its
  288.         contents the same as the command line.  (This is
  289.         intended primarily for getting around DOS'
  290.         128-character limit on the length of a command line.)
  291.         Switches or file names in the file may be separated by
  292.         any amount of white space (space, tab, line break);
  293.         there is no limit on the size of the file.
  294.  
  295.     -- filename arg1 ...
  296.         Takes the next argument as a file name as usual, but takes
  297.         all remaining arguments (even if they have the syntactic
  298.         form of switches) and defines the name ARGUMENTS in
  299.         userdict (not systemdict) as an array of those strings,
  300.         *before* running the file.  When Ghostscript finishes
  301.         executing the file, it exits back to the shell.
  302.  
  303.     -Dname=token
  304.     -dname=token
  305.         Define a name in systemdict with the given definition.
  306.         The token must be exactly one token (as defined by the
  307.         'token' operator) and must not contain any whitespace.
  308.  
  309.     -Dname
  310.     -dname
  311.         Define a name in systemdict with value=null.
  312.  
  313.     -Sname=string
  314.     -sname=string
  315.         Define a name in systemdict with a given string as value.
  316.         This is different from -d.  For example,
  317.             -dname=35
  318.         is equivalent to the program fragment
  319.             /name 35 def
  320.         whereas
  321.             -sname=35
  322.         is equivalent to
  323.             /name (35) def
  324.  
  325.     -q
  326.         Quiet startup -- suppress normal startup messages,
  327.         and also do the equivalent of -dQUIET.
  328.  
  329.     -gnumber1xnumber2
  330.         Equivalent to -dDEVICEWIDTH=number1 and
  331.         -dDEVICEHEIGHT=number2.  This is for the benefit of
  332.         devices (such as X11 windows and VESA displays) that require
  333.         (or allow) width and height to be specified.
  334.  
  335.     -rnumber
  336.     -rnumber1xnumber2
  337.         Equivalent to -dDEVICEXRESOLUTION=number1 and
  338.         -dDEVICEYRESOLUTION=number2.  This is for the benefit of
  339.         devices (such as printers) that support multiple
  340.         X and Y resolutions.
  341.  
  342.     -Idirectories
  343.         Adds the designated list of directories at the head of the
  344.         search path for library files.
  345.  
  346.     -
  347.         This is not really a switch.  It indicates to Ghostscript
  348.         that the standard input is coming from a file or a pipe.
  349.         Ghostscript reads from stdin until reaching end-of-file,
  350.         executing it like any other file, and then continues
  351.         processing the command line.  At the end of the command
  352.         line, Ghostscript exits rather than going into its
  353.         interactive mode.
  354.  
  355. Note that gs_init.ps makes systemdict read-only, so the values of names
  356. defined with -D/d/S/s cannot be changed (although, of course, they can be
  357. superseded by definitions in userdict or other dictionaries.)
  358.  
  359. Special names
  360. -------------
  361.  
  362. -dASCIIOUT
  363.     disables Ghostscript's normal behavior; instead, writes strings to
  364. stdout that would have been displayed or printed.  For more information,
  365. see the file gs_2asc.ps.
  366.  
  367. -dDISKFONTS
  368.     causes individual character outlines to be loaded from the disk
  369. the first time they are encountered.  (Normally Ghostscript loads all the
  370. character outlines when it loads a font.)  This may allow loading more
  371. fonts into RAM, at the expense of slower rendering.
  372.  
  373. -dNOBIND
  374.     disables the 'bind' operator.  Only useful for debugging.
  375.  
  376. -dNOCACHE
  377.     disables character caching.  Only useful for debugging.
  378.  
  379. -dNODISPLAY
  380.     suppresses the normal initialization of the output device.  This
  381. may be useful when debugging.
  382.  
  383. -dNOPAUSE
  384.     disables the prompt and pause at the end of each page.  This may
  385. be desirable for applications where another program is 'driving'
  386. Ghostscript.
  387.  
  388. -dSAFER
  389.     disables the deletefile and renamefile operators, and the
  390. ability to open files in any mode other than read-only.  This may be
  391. desirable for spoolers or other sensitive environments.
  392.  
  393. -dWRITESYSTEMDICT
  394.     leaves systemdict writable.  This is necessary when running
  395. special utility programs such as font2c and pcharstr, which must bypass
  396. normal PostScript access protection.
  397.  
  398. -sDEVICE=device
  399.     selects an alternate initial output device, as described above.
  400.  
  401. -sOutputFile=filename
  402.     selects an alternate output file (or pipe) for the initial output
  403. device, as described above.
  404.  
  405. Debugging switches
  406. ------------------
  407.  
  408. The -Z switch only applies if the interpreter was built for a
  409. debugging configuration (DEBUG=1 or -DDEBUG selected at compile
  410. time).
  411.  
  412.     -A    Turn on allocator debugging (gs_malloc and gs_free).
  413.  
  414.     -e    Turn on tracing of error returns from operators.
  415.  
  416.     -E    Abort when any operator returns with an error.
  417.  
  418.     -Mn    Force the interpreter's allocator to acquire additional
  419.         memory in units of nK, rather than the default (currently
  420.         20K on MS-DOS systems, 50K on Unix).  n is a positive
  421.         decimal integer (not exceeding 63 on MS-DOS systems).
  422.  
  423.     -Zxxx    Turn on debugging printout.
  424.         Each of the xxx characters selects an option:
  425.         if the string is empty, all options are selected.
  426.         Case is significant.
  427.             1 = type 1 font interpreter (type1addpath)
  428.             2 = curve subdivider/rasterizer
  429.             a = allocator (large blocks only)
  430.               A = allocator (all calls)
  431.             b = bitmap image processor
  432.               B = bitmap images, detail
  433.             c = color/halftone mapper
  434.             d = dictionary put/undef
  435.             f = fill algorithm (summary)
  436.               F = fill algorithm (detail)
  437.             g = gsave/grestore[all]
  438.             h = halftone renderer
  439.             i = interpreter, just names
  440.               I = interpreter, everything
  441.             k = character cache
  442.               K = character cache, every access
  443.             l = command lists, bands
  444.               L = command lists, everything
  445.             m = makefont and font cache
  446.             n = name lookup (new names only)
  447.             o = outliner (stroke)
  448.             p = path tracer
  449.             q = clipping
  450.             r = arc renderer
  451.             s = scanner
  452.             t = tiling algorithm
  453.             u = undo saver (for save/restore)
  454.               U = undo saver, more detail
  455.             v = rectangle fill
  456.               V = device-level output
  457.             w = compression encoder/decoder
  458.             x = transformations
  459.             z = trapezoid fill
  460.